package com.xcf.service.business.common.cca.impl;



import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.entity.Page;
import com.xcf.service.business.common.cca.CCACostService;
import com.xcf.util.PageData;

@Service("CCACostServiceImpl")
public class CCACostServiceImpl  implements CCACostService{
	@Resource(name="daoSupport")
	private  DaoSupport daosuport;

	//列表的显示和查询
	@Override
	public List<Map> seach(PageData pd) throws Exception {
		
		return (List<Map>) daosuport.findForList("CCACostMapper.seach", pd);
	}

	//保存
	@Override
	public void addCCA(PageData pd) {
		
		try {
			daosuport.save("CCACostMapper.save", pd);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	//去修改页面
	@Override
	public PageData seacById(PageData pd) throws Exception {
		
		return (PageData) daosuport.findForObject("CCACostMapper.seacById", pd);
	}
 
	//修改页面的保存
	@Override
	public void updateCCA(PageData pd) {
		try {
			daosuport.update("CCACostMapper.editU", pd);
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		
	}

	//删除
	@Override
	public void delete(PageData pd) {
		try {
			daosuport.delete("CCACostMapper.deleteU", pd);
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		
	}

	@Override
	public void updateInfo(PageData pd) throws Exception {
		daosuport.update("CCACostMapper.updateInfo", pd);
		
	}

	@Override
	public void update(PageData pd) throws Exception {
		daosuport.update("CCACostMapper.update", pd);
		
	}

	@Override
	public List<PageData> sear(PageData pd) throws Exception {
		
		return (List<PageData>) daosuport.findForList("CCACostMapper.sear", pd);
		
	}

}
